home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / NET / IRDA / TIMER.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  83 lines

  1. /*********************************************************************
  2.  *                
  3.  * Filename:      timer.h
  4.  * Version:       
  5.  * Description:   
  6.  * Status:        Experimental.
  7.  * Author:        Dag Brattli <dagb@cs.uit.no>
  8.  * Created at:    Sat Aug 16 00:59:29 1997
  9.  * Modified at:   Tue Apr  6 16:17:16 1999
  10.  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  11.  * 
  12.  *     Copyright (c) 1997, 1998 Dag Brattli <dagb@cs.uit.no>, 
  13.  *     All Rights Reserved.
  14.  *     
  15.  *     This program is free software; you can redistribute it and/or 
  16.  *     modify it under the terms of the GNU General Public License as 
  17.  *     published by the Free Software Foundation; either version 2 of 
  18.  *     the License, or (at your option) any later version.
  19.  *
  20.  *     Neither Dag Brattli nor University of Troms° admit liability nor
  21.  *     provide warranty for any of this software. This material is 
  22.  *     provided "AS-IS" and at no charge.
  23.  *
  24.  ********************************************************************/
  25.  
  26. #ifndef TIMER_H
  27. #define TIMER_H
  28.  
  29. #include <asm/param.h>  /* for HZ */
  30.  
  31. #include <net/irda/irda.h>
  32. #include <net/irda/irmod.h>
  33. #include <net/irda/irlap.h>
  34. #include <net/irda/irlmp.h>
  35. #include <net/irda/irda_device.h>
  36.  
  37. /* 
  38.  *  Timeout definitions, some defined in IrLAP p. 92
  39.  */
  40. #define POLL_TIMEOUT        450*HZ/1000    /* Must never exceed 500 ms */
  41. #define FINAL_TIMEOUT       500*HZ/1000    /* Must never exceed 500 ms */
  42.  
  43. /* 
  44.  *  Normally twice of p-timer. Note 3, IrLAP p. 60 suggests at least twice 
  45.  *  duration of the P-timer.
  46.  */
  47. #define WD_TIMEOUT          POLL_TIMEOUT*2
  48. #define MEDIABUSY_TIMEOUT   500*HZ/1000    /* 500 msec */
  49.  
  50. /*
  51.  *  Slot timer must never exceed 85 ms, and must always be at least 25 ms, 
  52.  *  suggested to  75-85 msec by IrDA lite
  53.  */
  54. #define SLOT_TIMEOUT            80*HZ/1000
  55. #define QUERY_TIMEOUT           HZ          /* 1 sec */
  56.  
  57. #define WATCHDOG_TIMEOUT        20*HZ       /* 20 sec */
  58.  
  59. typedef void (*TIMER_CALLBACK)(unsigned long);
  60.  
  61. void irda_start_timer(struct timer_list *ptimer, int timeout, int data,
  62.               TIMER_CALLBACK callback);
  63.  
  64. inline void irlap_start_slot_timer(struct irlap_cb *self, int timeout);
  65. inline void irlap_start_query_timer(struct irlap_cb *self, int timeout);
  66. inline void irlap_start_final_timer(struct irlap_cb *self, int timeout);
  67. inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout);
  68. inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout);
  69.  
  70. inline void irda_device_start_mbusy_timer(struct irda_device *self);
  71.  
  72. struct lsap_cb;
  73. struct lap_cb;
  74. inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout);
  75. inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout);
  76. inline void irlmp_start_idle_timer(struct lap_cb *, int timeout);
  77.  
  78. struct irobex_cb;
  79. inline void irobex_start_watchdog_timer(struct irobex_cb *, int timeout);
  80.  
  81. #endif
  82.  
  83.